package cn.tedu.boot52.mapper;

import cn.tedu.boot52.entity.Hero;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface HeroMapper {
    @Insert("insert into hero values(null,#{name},#{gender},#{type})")
    void insert(Hero hero);

    @Select("select * from hero")
    List<Hero> select();

    @Delete("delete from hero where id=#{id}")
    void deleteById(int id);

    @Select("select * from hero where id=#{id}")
    Hero selectById(int id);

    @Update("update hero set name=#{name},gender=#{gender},type=#{type} where id=#{id}")
    void update(Hero hero);
}
